<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="com.google.appengine.api.users.UserService" %>
<%@ page import="com.google.appengine.api.users.UserServiceFactory" %>
<%@ page import="kulstats.Registry" %>
<%@ page import="kulstats.User" %>
<%@ page import="kulstats.UserManager" %>

<%

UserManager userManager = Registry.userManager();
User currentUser = userManager.getCurrentUser();
if(currentUser != null)
	response.sendRedirect("/home");

UserService userService = UserServiceFactory.getUserService();
String loginURL = userService.createLoginURL("/DoLogin");

%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html> 
<head> 
	<title>Log In - StAPP</title> 
	
	<%@ include file="mobileResources.inc.jsp" %>
	
</head> 

<body>
<div data-role="page" id="login">
	<div data-role="header">
		<h1>Log In</h1>
	</div><!-- /header -->
	<div data-role="content">
		<h1>Login</h1>
		<p>To use kulStats, you need to login with your Google Account:</p>
		<p style="text-align: center;"><a href="<%= loginURL %>" rel="external"><img src="images/google_login.png" /></a></p>
	</div><!-- /content -->
	<div data-role="footer">
		<h4>&copy; 2011 - StAPP</h4>
	</div><!-- /footer -->
</div><!-- /page -->


</body>
</html>